package net.cloudcodex.shared.dto.msg;

import java.io.Serializable;
import java.util.List;

import net.cloudcodex.shared.MessageAction;
import net.cloudcodex.shared.MessageType;

/**
 * A message in a scene.
 * @author Thomas
 */
public class MessageDTO implements Serializable {

	/**
	 * Message id.
	 */
	private Long id;

	/**
	 * Message type : Action, OFF, DiceRoll.
	 * If <code>null</code> then the message is a scene introduction.
	 */
	private MessageType type;
	
	/**
	 * Action type : Speech, whisp, ...
	 */
	private MessageAction action;
	
	/**
	 * Content of the message, when SPEECH or OFF.
	 */
	private String content;

	/**
	 * Author (Character) id. <code>null</code> for GM.
	 */
	private Long author;

	/**
	 * Dices results in "<score>/<sides>" format.
	 */
	private List<String> dices;
	
	/**
	 * <code>true</code> if the message has been deleted and instance is
	 * here only to notify the message deletion (content and dices are
	 * set to <code>null</code>).
	 */
	private boolean deleted = false;

	/**
	 * Used to order the messageS.
	 */
	private long index;
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the type
	 */
	public MessageType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(MessageType type) {
		this.type = type;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the action
	 */
	public MessageAction getAction() {
		return action;
	}

	/**
	 * @param action the action to set
	 */
	public void setAction(MessageAction action) {
		this.action = action;
	}

	/**
	 * @return the dices
	 */
	public List<String> getDices() {
		return dices;
	}

	/**
	 * @param dices the dices to set
	 */
	public void setDices(List<String> dices) {
		this.dices = dices;
	}

	/**
	 * @return the author
	 */
	public Long getAuthor() {
		return author;
	}

	/**
	 * @param author the author to set
	 */
	public void setAuthor(Long author) {
		this.author = author;
	}

	/**
	 * @return the deleted
	 */
	public boolean isDeleted() {
		return deleted;
	}

	/**
	 * @param deleted the deleted to set
	 */
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	/**
	 * @return the index
	 */
	public long getIndex() {
		return index;
	}

	/**
	 * @param index the index to set
	 */
	public void setIndex(long index) {
		this.index = index;
	}
	
}
